package com.nightsoul.groovy.integeration;


import groovy.lang.Binding;
import groovy.lang.GroovyShell;
import groovy.util.Eval;

public class ExpressionEvaluation {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GroovyShell shell = new GroovyShell();
		Object result = shell.evaluate("'hello '<<'world'");
		System.out.println(result);
		
		result = Eval.me("2*4+6");
		System.out.println(result);
		
		Eval.x("name", "println x");
		
		Binding binding = new Binding();
		binding.setVariable("mass", 1);
		binding.setVariable("velocity", 10);
		shell = new GroovyShell(binding);
		System.out.println(shell.evaluate("mass * velocity ** 2"));
		
	}

}
